package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import cn.zhf.shop.entity.Cooperation;
import cn.zhf.shop.mapper.CooperationMapper;
import cn.zhf.shop.service.CooperationService;import java.util.List;

@Service
public class CooperationServiceImpl implements CooperationService {

    @Resource
    private CooperationMapper cooperationMapper;

    @Override
    public Message deleteByPrimaryKey(Integer cooperationId) {
        return cooperationMapper.deleteByPrimaryKey(cooperationId)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(Cooperation record) {
        return cooperationMapper.insert(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insertSelective(Cooperation record) {
        return cooperationMapper.insertSelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer cooperationId) {
        return Message.success(null).add(cooperationMapper.selectByPrimaryKey(cooperationId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Cooperation record) {
        return cooperationMapper.updateByPrimaryKeySelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Cooperation record) {
        return cooperationMapper.updateByPrimaryKey(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(cooperationMapper.selectAll());
    }
}

